home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Magazine / CDRipping / Normalize / README < prev    next >
Encoding:
Text File  |  2001-01-31  |  6.6 KB  |  143 lines

  1. This is release 0.4 of Normalize, a wave file volume normalizer.
  2. Copyleft 2001, Chris Vaill <cvaill@cs.columbia.edu>
  3. Compiled under Amiga by Fr3dY <fr3dy@retemail.es>
  4.  
  5. Normalize is an overly complicated tool for adjusting the volume of
  6. wave files to a standard volume level.  This is useful for things like
  7. creating mp3 mixes, where different recording levels on different
  8. albums can cause the volume to vary greatly from song to song.
  9.  
  10. Send bug reports, suggestions, comments to cvaill@cs.columbia.edu.
  11.  
  12. normalize is free software.  See the file COPYING for copying conditions.
  13.  
  14. -------------------------------------------------------------------------
  15.  
  16. 1 What platforms does this work on?
  17.        I've tested normalize on GNU/Linux on x86 and Solaris on
  18.        sparc.  I've heard that it works on GNU/Linux on alpha and
  19.        on BeOS R5 (using the configure options --with-included-gettext
  20.        and --disable-nls).
  21.  
  22.        I've tried to make the code as portable as possible, so
  23.        I'd appreciate hearing whether normalize works on other
  24.        platforms.
  25.  
  26. 2 What is this useful for?
  27.        Let's say you've got a bunch of wav files containing what
  28.        are, in your estimation, Elvis's greatest hits, collected
  29.        from various albums.  You want to encode them as mp3's and
  30.        add them to an established collection, but since they're
  31.        all from different albums, they're all recorded at differ­
  32.        ent volumes from each other and from the rest of your mp3
  33.        collection.  If you've been using normalize on all your
  34.        wav files before you encode them, your collection is nor­
  35.        malized to the default volume level, and you want these
  36.        new additions to be at the same level.  Just run normalize
  37.        with no options on the files, and each will be adjusted to
  38.        the proper volume level:
  39.  
  40.             normalize "Hound Dog.wav" "Blue Suede Shoes.wav" \
  41.                       "Here Comes Santa Claus.wav" ...
  42.  
  43.        Suppose now you've just extracted all the wav files from
  44.        the Gorilla Biscuits album "Start Today," which, you may
  45.        know, is recorded at a particularly low volume.  We want
  46.        to make the whole album louder, but individual tracks
  47.        should stay at the same volume relative to each other.
  48.        For this we use batch mode.  Say the files are named
  49.        01.wav to 14.wav, and are in the current directory.  We
  50.        invoke normalize in batch mode to preserve the relative
  51.        volumes, but otherwise, everything's the default:
  52.  
  53.             normalize -b *.wav
  54.  
  55.        You can then fire up your mp3 encoder, and the whole album
  56.        will be uniformly louder.
  57.  
  58.        Now suppose we want to encode the Converge album "When
  59.        Forever Comes Crashing."  This album has one song, "Ten
  60.        Cents," that is really quiet while the rest of the songs
  61.        have about the same (loud) volume.  We'll turn up the ver­
  62.        bosity so we can see what's going on:
  63.  
  64.             > normalize -bv *.wav
  65.             Computing levels...
  66.             Level for 01.wav: 0.339
  67.             Level for 02.wav: 0.345
  68.             Level for 03.wav: 0.370
  69.             Level for 04.wav: 0.366
  70.             Level for 05.wav: 0.394
  71.             Level for 06.wav: 0.388
  72.             Level for 07.wav: 0.358
  73.             Level for 08.wav: 0.209
  74.             Level for 09.wav: 0.354
  75.             Level for 10.wav: 0.390
  76.             Level for 11.wav: 0.373
  77.             Standard deviation is 1.48 dB
  78.             Throwing out level of 0.209 (different by 4.65dB)
  79.             Average level: 0.368
  80.             Applying gain of 0.679...
  81.  
  82.        The volume of "Ten Cents," which is track 8, is 4.65 deci­
  83.        bels off the average, which, given a standard deviation of
  84.        1.48 decibels, makes it a statistical aberration (which
  85.        I've defined as anything off by more that twice the stan­
  86.        dard deviation, but you can set a constant decibel thresh­
  87.        old with the -t option).  Therefore, it isn't counted in
  88.        the average, and the adjustment applied to the album isn't
  89.        thrown off because of one song.
  90.  
  91.        Finally, say you want to make a mixed CD of 80's songs for
  92.        your mom or something.  You won't allow any 80's songs to
  93.        taint your hallowed mp3 collection, so the absolute vol­
  94.        umes of these tracks don't matter, as long as they're all
  95.        about the same, so mom doesn't have to keep adjusting the
  96.        volume.  For this, use the mix mode option,
  97.  
  98.             normalize -m *.wav
  99.  
  100.        and each track will be adjusted to the average level of
  101.        all the tracks.
  102.  
  103. 3 How does it work?
  104.        This is just a little background on how normalize computes
  105.        the volume of a wav file, in case you want to know just
  106.        how your files are being munged.
  107.  
  108.        The volumes calculated are RMS amplitudes, which corre­
  109.        spond (roughly) to perceived volume.  Taking the RMS
  110.        amplitude of an entire file would not give us quite the
  111.        measure we want, though, because a quiet song punctuated
  112.        by short loud parts would average out to a quiet song, and
  113.        the adjustment we would compute would make the loud parts
  114.        excessively loud.
  115.  
  116.        What we want is to consider the maximum volume of the
  117.        file, and normalize according to that.  We break up the
  118.        signal into 100 chunks per second, and get the signal
  119.        power of each chunk, in order to get an estimation of
  120.        "instantaneous power" over time.  This "instantaneous
  121.        power" signal varies too much to get a good measure of the
  122.        original signal's maximum sustained power, so we run a
  123.        smoothing algorithm over the power signal (specifically, a
  124.        mean filter with a window width of 100 elements).  The
  125.        maximum point of the smoothed power signal turns out to be
  126.        a good measure of the maximum sustained power of the file.
  127.        We can then take the square root of the power to get maxi­
  128.        mum sustained RMS amplitude.
  129.  
  130.        As for the default target amplitude of 0.25, I've found
  131.        that it's pretty close to the level of most of my albums
  132.        already, but not so high as to cause a lot of clipping on
  133.        quieter albums.  You may want to choose a different target
  134.        amplitude, depending on your music collection (just make
  135.        sure you normalize everything to the same amplitude if you
  136.        want it to all be the same volume!).
  137.  
  138.        Please note that I'm not an electrical engineer or statis­
  139.        tician, so my signal processing theory may be off.  I'd be
  140.        glad to hear from any signal processing wizards if I've
  141.        made faulty assumptions regarding signal power, perceived
  142.        volume, or any of that fun signal theory stuff.
  143.